import { requestAjax } from './http'

export interface PermissionsVO {
  _id: string
  name: string
  code: string
}

export function getPubAdminPermissionsListAll (params?: any) {
  console.log(params);
    const res = {
    "code": 200,
    "status": 200,
    "data": [
        {
            "_id": "68b5df688c329572c5e3a94c",
            "name": "首页权限",
            "code": "home",
            "parentCode": "",
            "routeCodes": [
                "homeList",
                "aboutUs",
                "demoOne",
                "demoOneList",
                "demoTwo",
                "demoTwoList",
                "demoThree",
                "demoThreeList",
                "demoFour",
                "demoFourList"
            ],
            "createTime": "2025-09-01T18:01:12.595Z",
            "updateTime": "2025-09-01T18:01:12.595Z",
            "createBy": "",
            "updateBy": ""
        },
        {
            "_id": "68b5df688c329572c5e3a94d",
            "name": "系统管理权限",
            "code": "systemManage",
            "parentCode": "",
            "routeCodes": [
                "userManageList",
                "userManageActionInsert",
                "userManageActionDelete",
                "userManageActionUpdate",
                "roleManageList",
                "roleManageActionInsert",
                "roleManageActionDelete",
                "roleManageActionUpdate",
                "routeManageList",
                "routeManageActionInsert",
                "routeManageActionDelete",
                "routeManageActionUpdate",
                "permissionsManageList",
                "permissionsManageActionInsert",
                "permissionsManageActionDelete",
                "permissionsManageActionUpdate",
                "dictManageList",
                "dictDataList",
                "dictManageActionInsert",
                "dictManageActionDelete",
                "dictManageActionUpdate",
                "logManageList",
                "systemManage",
                "demoOne",
                "demoOneList",
                "demoOneActionInsert",
                "demoOneActionDelete",
                "demoOneActionUpdate",
                "DemoOneDetails",
                "demoTwo",
                "demoTwoList",
                "DemoTwoAdd",
                "demoTwoActionDelete",
                "DemoTwoEdit",
                "DemoTwoDetails",
                "demoThree",
                "demoThreeList",
                "demoThreeActionInsert",
                "demoThreeActionDelete",
                "demoThreeActionUpdate",
                "demoThreeActionView",
                "demoFour",
                "demoFourList",
                "demoFourActionInsert",
                "demoFourActionDelete",
                "demoFourActionUpdate",
                "demoFourActionView"
            ],
            "createTime": "2025-09-01T18:01:12.595Z",
            "updateTime": "2025-09-01T18:01:12.595Z",
            "createBy": "",
            "updateBy": ""
        },
        {
            "_id": "68b5df688c329572c5e3a94e",
            "name": "系统视图权限",
            "code": "systemView",
            "parentCode": "",
            "routeCodes": [
                "userManageList",
                "roleManageList",
                "routeManageList",
                "permissionsManageList",
                "dictManageList",
                "dictDataList",
                "logManageList",
                "systemManage",
                "demoOne",
                "demoOneList",
                "demoOneActionInsert",
                "demoOneActionDelete",
                "demoOneActionUpdate",
                "DemoOneDetails",
                "demoTwo",
                "demoTwoList",
                "DemoTwoAdd",
                "demoTwoActionDelete",
                "DemoTwoEdit",
                "DemoTwoDetails",
                "demoThree",
                "demoThreeList",
                "demoThreeActionInsert",
                "demoThreeActionDelete",
                "demoThreeActionUpdate",
                "demoThreeActionView",
                "demoFour",
                "demoFourList",
                "demoFourActionInsert",
                "demoFourActionDelete",
                "demoFourActionUpdate",
                "demoFourActionView"
            ],
            "createTime": "2025-09-01T18:01:12.595Z",
            "updateTime": "2025-09-01T18:01:12.595Z",
            "createBy": "",
            "updateBy": ""
        },
        {
            "_id": "68b5df688c329572c5e3a94f",
            "name": "项目管理权限",
            "code": "projectManage",
            "parentCode": "",
            "routeCodes": [
                "userManageList",
                "userManageActionInsert",
                "userManageActionDelete",
                "userManageActionUpdate",
                "systemManage",
                "demoOne",
                "demoOneList",
                "demoOneActionInsert",
                "demoOneActionDelete",
                "demoOneActionUpdate",
                "DemoOneDetails",
                "demoTwo",
                "demoTwoList",
                "DemoTwoAdd",
                "demoTwoActionDelete",
                "DemoTwoEdit",
                "DemoTwoDetails",
                "demoThree",
                "demoThreeList",
                "demoThreeActionInsert",
                "demoThreeActionDelete",
                "demoThreeActionUpdate",
                "demoThreeActionView",
                "demoFour",
                "demoFourList",
                "demoFourActionInsert",
                "demoFourActionDelete",
                "demoFourActionUpdate",
                "demoFourActionView"
            ],
            "createTime": "2025-09-01T18:01:12.595Z",
            "updateTime": "2025-09-01T18:01:12.595Z",
            "createBy": "",
            "updateBy": ""
        }
    ],
    "msg": ""
};
    return Promise.resolve(res);
}

export function postPubAdminPermissionsSaveBatch (data?: any) {
  return requestAjax({
    url: '/api/pub/admin/permissions/save/batch',
    method: 'post',
    data
  })
}

export function deletePubAdminPermissionsDelete (data?: any) {
  return requestAjax({
    url: '/api/pub/admin/permissions/delete',
    method: 'delete',
    data
  })
}
